package com.itheima_11;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class test_11 {
    public static void main(String[] args) {
        int count=0;
        List<Integer> list=new ArrayList();
        Random r=new Random();
        while (count<10){
            int k = r.nextInt(100) + 1;
                if(ArraryLists(list,k)==true){
                    continue;
                }else {
                    list.add(k);
                    count++;
                }
            }
        ArrarListPai((ArrayList)list);
        for (Object o : list) {
            System.out.print(o+" ");
        }
    }
    public static boolean ArraryLists(List list,int num) {
            if (list.contains(num)) {
                return true;
            }
            return false;
        }
        public static void ArrarListPai(List<Integer> list ){

            for (int i= 0; i < list.size()-1; i++) {
                for (int j = 0; j < list.size()-1-i; j++) {

                    if(list.get(j)>list.get(j+1)){
                             int temp=list.get(j+1);
                             list.set(j+1,list.get(j));
                             list.set(j,temp);
                    }
                }
            }
        }
}
